/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.ipo.mm.web.formbeans;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author makcro
 */
public class BulkMailBean extends org.apache.struts.validator.ValidatorForm {

    private String[] selectedRepresentatives;

    public String[] getSelectedRepresentatives() {
        return selectedRepresentatives;
    }

    public void setSelectedRepresentatives(String[] selectedRepresentatives) {
        this.selectedRepresentatives = selectedRepresentatives;
    }



    /**
     *
     */
    public BulkMailBean() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = super.validate(mapping, request);


        if(selectedRepresentatives == null){
            errors.add("selectedRepresentatives", new ActionMessage("repr_no_selected"));
        }

        return errors;
    }
}
